﻿@model RiverCruise.Models.Account.ChangePasswordViewModel

@{
    ViewBag.Title = "Change Password";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="container-fluid">
    <h2>Change Password</h2>
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-6 col-md-offset-3" id="loginBox">
                @using (Html.BeginForm("ChangePassword", "Account", FormMethod.Post, new { ReturnUrl = ViewBag.ReturnUrl }))
                {
                    @Html.AntiForgeryToken()
                    <fieldset>
                        <legend>Change password:</legend>
                        @if (!ViewData.ModelState.IsValid)
                        {
                            <div class="bs-callout bs-callout-danger text-danger">
                                @Html.ValidationSummary()
                            </div>
                        }
                        
                        @if (Model.PasswordChanged)
                        {
                            <div class="bs-callout bs-callout-succes text-success">
                                <ul><li>Your password has been changed.</li></ul>
                            </div>
                        }
                        
                        <div class="form-group">
                            @Html.LabelFor(model => model.OldPassword)
                            @Html.PasswordFor(model => model.OldPassword, new { @class = "form-control", placeholder = "Current Password" })
                            <span class="text-danger">@Html.ValidationMessageFor(model => model.OldPassword)</span>
                            <br />
                        </div>
                        
                        <div class="form-group">
                            @Html.LabelFor(model => model.NewPassword)
                            @Html.PasswordFor(model => model.NewPassword, new { @class = "form-control", placeholder = "New Password" })
                            <span class="text-danger">@Html.ValidationMessageFor(model => model.NewPassword)</span>
                            <br />
                        </div>
                        
                        <div class="form-group">
                            @Html.LabelFor(model => model.NewPasswordConfirm)
                            @Html.PasswordFor(model => model.NewPasswordConfirm, new { @class = "form-control", placeholder = "New Password" })
                            <span class="text-danger">@Html.ValidationMessageFor(model => model.NewPasswordConfirm)</span>
                            <br />
                        </div>

                        <div class="form-group text-center">
                            <input type="submit" value="Change password" class="btn btn-default btn-block" />
                        </div>
                    </fieldset>

                }
            </div>
        </div>
    </div>
</div>

